package com.qf.dao.impl;

import com.qf.dao.CategoryDao;
import com.qf.entity.Category;
import com.qf.utils.DBUtils;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class CategoryDaoImpl implements CategoryDao {
    @Override
    public List<Category> selectAll() throws SQLException {
        String sql = "SELECT * FROM category";
        return DBUtils.DB.qr.query(sql, new BeanListHandler<>(Category.class));
    }
}
